package com.dwj.auto.comment.common.enums;

/**
 * @ClassName CommentType
 * @Description 评语类型
 * @Author dwjian
 * @Date 2020/2/9 11:45
 */
public enum CommentType {

    IMPRESSION(1, "印象"),
    DISCIPLINE(2, "纪律"),
    CLASSROOM(3, "课堂"),
    SPEAK(4, "发言"),
    HOMEWORK(5, "作业"),
    JOB(6, "工作"),
    SCORE(7, "成绩"),
    EXPECT(8, "期望");

    private int code;
    private String desc;

    CommentType(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static CommentType getEnumByDesc(String desc){
        for (CommentType value : CommentType.values()) {
            if(value.desc.equals(desc)){
                return value;
            }
        }
        return null;
    }

    public static CommentType getEnumByCode(int code){
        for (CommentType value : CommentType.values()) {
            if(value.code == code){
                return value;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
